All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.anim.TwoDSprite

java.lang.Object
   |
   +----quicktime.app.anim.TwoDSprite

public class TwoDSprite
extends Object
implements NotifyListener, Transformable, Layerable, ImageSettable, Compositable
A TwoDSprite is a specialised presenter for image data within the context of a SpriteWorld. It contains information also about the layer within the SpriteWorld that the image presented by the Sprite is drawn. It also contains information about visibility and Matrix transformations and GraphicsMode drawing transformations that are applied to the image data when the Sprite is drawn in the SpriteWorld.

Typically an application will provide the image data and presentation characteristics and the SWCompositor assumes the responsibility of creating the actual TwoDSprite's Sprite that is used to present this data in the internal SpriteWorld that the SWCompositor uses to render and construct its image. The TwoDSprite uses the quicktime.std.anim.Sprite class to draw the image in a quicktime.std.anim.SpriteWorld.

See Also:
Compositor, TwoDSpriteInfo

Constructor Index

 o TwoDSprite()
Create a sprite that will use a hidden image, visibility set to false and an Identity matrix.
 o TwoDSprite(ImageDataSequence, int, Matrix, boolean, int)
This constructor provides all of the state which will be used by the TwoDSprite object to create itself when it is attached to a SpriteWorld.
 o TwoDSprite(ImageDataSequence, int, Matrix, boolean, int, GraphicsMode)
This constructor provides all of the state which will be used by the TwoDSprite object to create itself when it is attached to a SpriteWorld.
 o TwoDSprite(ImageSpec, Matrix, boolean, int)
This constructor provides all of the state which will be used by the TwoDSprite object to create itself when it is attached to a SpriteWorld.
 o TwoDSprite(ImageSpec, Matrix, boolean, int, GraphicsMode)
This constructor provides all of the state which will be used by the TwoDSprite object to create itself when it is attached to a SpriteWorld.
 o TwoDSprite(Matrix, int, GraphicsMode)
Create a sprite that will use a hidden image and visibility set to false.
 o TwoDSprite(TwoDSpriteInfo)
Create a sprite when the final destination of the sprite is not known.

Method Index

 o createSprite(SpriteWorld)
This will create a sprite object that presents the specified image and display options as specified in the contained info object.
 o equals(Object)
Returns true if the TwoDSprite represents the same Sprite object
 o getDescription()
This method gets the image description property of this sprite.
 o getGraphicsMode()
This method gets the graphics mode property of this sprite.
 o getImage()
This method returns the actual image data.
 o getInitialSize()
This method returns the original size before the transformations specified in the returned matrix are applied.
 o getLayer()
This method gets the layer property of this sprite.
 o getMatrix()
This method returns the current matrix of the Transformable object.
 o getParent()
Return the sprite world that this sprite belongs too.
 o getSpriteInfo()
Returns all of the pertinent information about the current sprite's state to recreate a sprite.
 o getVisible()
This method gets the visibility property of this sprite.
 o hitTest(int, QDPoint)
This method tests if a point is inside a sprite.
 o invalidate()
This method invalidates the portion of the sprite's sprite world which is occupied by the sprite.
 o isValid()
Returns true if the Sprite being used by the TwoDSprite is valid and thus is constructed and present in a SpriteWorld.
 o notifyComplete()
This method is called by the Notifier object when the image data that it is supplying to the TwoDSprite is valid.
 o remove()
This will remove the sprite from the SpriteWorld it is contained in and destroy its internal structures.
 o removeNotify()
This call should not be called by an application.
 o setDescription(ImageDescription)
This method sets the image description property of this sprite.
 o setGraphicsMode(GraphicsMode)
This method sets the graphics mode property of this sprite.
 o setImage(EncodedImage)
This method should make the object's current image the specified image.
 o setImageData(EncodedImage, ImageDescription)
This method can be used to change the image that is being presented by the Sprite and to ensure that the sprite is visible, if the specified image data is not null.
 o setLayer(int)
This method sets the layer property of this sprite.
 o setMatrix(Matrix)
This method sets the current matrix of the Transformable object to the new matrix.
 o setNotifier(Notifier)
This registers the deferred listener.
 o setVisible(boolean)
This method sets the visibility property of this sprite.
 o toString()
Returns a String representation of this class.

Constructors

 o TwoDSprite
 public TwoDSprite(TwoDSpriteInfo spriteInfo) throws QTException
Create a sprite when the final destination of the sprite is not known. This constructor provides all of the state which will be used by the TwoDSprite object to create itself when it is attached to a SpriteWorld.

Parameters:
spriteInfo - the image and layout information for the sprite when it is created.
 o TwoDSprite
 public TwoDSprite() throws QTException
Create a sprite that will use a hidden image, visibility set to false and an Identity matrix.

 o TwoDSprite
 public TwoDSprite(Matrix matrix,
                   int layer,
                   GraphicsMode graphicsMode) throws QTException
Create a sprite that will use a hidden image and visibility set to false. This constructor is used when the TwoDSprite is being used as a NotifyListener, expecting the image data from a Notifier to arrive at some indeterminate time in the future. The arguments supplied here will be used when the image data is supplied by the Notifier.

Parameters:
matrix - the display matrix of the sprite
layer - the layer of the SpriteWorld where the Sprite will be drawn
graphicsMode - the GraphicsMode that is applied to the rendering of the image data, this can be null
 o TwoDSprite
 public TwoDSprite(ImageSpec image,
                   Matrix matrix,
                   boolean visibility,
                   int layer) throws QTException
This constructor provides all of the state which will be used by the TwoDSprite object to create itself when it is attached to a SpriteWorld.

Parameters:
image - the image data and description that describes the image of the sprite
matrix - the display matrix of the sprite
visibility - whether the sprite will be visible (true) or not (false) when created
layer - the layer of the SpriteWorld where the Sprite will be drawn
 o TwoDSprite
 public TwoDSprite(ImageSpec image,
                   Matrix matrix,
                   boolean visibility,
                   int layer,
                   GraphicsMode graphicsMode) throws QTException
This constructor provides all of the state which will be used by the TwoDSprite object to create itself when it is attached to a SpriteWorld.

Parameters:
image - the image data and description that describes the image of the sprite
matrix - the display matrix of the sprite
visibility - whether the sprite will be visible (true) or not (false) when created
layer - the layer of the SpriteWorld where the Sprite will be drawn
graphicsMode - the GraphicsMode that is applied to the rendering of the image data, this can be null
 o TwoDSprite
 public TwoDSprite(ImageDataSequence images,
                   int frame,
                   Matrix matrix,
                   boolean visibility,
                   int layer) throws QTException
This constructor provides all of the state which will be used by the TwoDSprite object to create itself when it is attached to a SpriteWorld.

Parameters:
images - the image data and description that describes the images of the sprite
frame - the frame number within the images that will be used as the current image for the sprite when it is created
matrix - the display matrix of the sprite
visibility - whether the sprite will be visible (true) or not (false) when created
layer - the layer of the SpriteWorld where the Sprite will be drawn
 o TwoDSprite
 public TwoDSprite(ImageDataSequence images,
                   int frame,
                   Matrix matrix,
                   boolean visibility,
                   int layer,
                   GraphicsMode graphicsMode) throws QTException
This constructor provides all of the state which will be used by the TwoDSprite object to create itself when it is attached to a SpriteWorld.

Parameters:
images - the image data and description that describes the images of the sprite
frame - the frame number within the images that will be used as the current image for the sprite when it is created
matrix - the display matrix of the sprite
visibility - whether the sprite will be visible (true) or not (false) when created
layer - the layer of the SpriteWorld where the Sprite will be drawn
graphicsMode - the GraphicsMode that is applied to the rendering of the image data, this can be null

Methods

 o setNotifier
 public boolean setNotifier(Notifier notifier)
This registers the deferred listener.

Parameters:
dl - the listener that the DeferredListener notifies when its listen source becomes valid
Returns:
true if the Notifier is an instanceof ImageSpec and thus is a valid Notifier for the TwoDSprite. Returns false if the Notifier is not an instanceof ImageSpec.
 o notifyComplete
 public void notifyComplete()
This method is called by the Notifier object when the image data that it is supplying to the TwoDSprite is valid.

 o setImageData
 public void setImageData(EncodedImage im,
                          ImageDescription id) throws QTException
This method can be used to change the image that is being presented by the Sprite and to ensure that the sprite is visible, if the specified image data is not null. This method is also called internally when the Notifier of this class notifies the Sprite that the image data is valid. If valid image data is provided this method also requires an ImageDescription that describes this image data.

Parameters:
im - the EncodedImage image data
id - the ImageDescription that describes the format of the EncodedImage data.
 o setImage
 public void setImage(EncodedImage image) throws QTException
This method should make the object's current image the specified image.

Parameters:
imageData - the new image data that the object should make its current image.
 o getParent
 public SWCompositor getParent()
Return the sprite world that this sprite belongs too. If the TwoDSprite is not currently attached to a SpriteWorld a SpriteInvalidException will be thrown.

Returns:
the current SpriteWorld of a valid TwoDSprite
 o isValid
 public boolean isValid()
Returns true if the Sprite being used by the TwoDSprite is valid and thus is constructed and present in a SpriteWorld. Returns false if not.

Returns:
a boolean
 o remove
 public void remove() throws QTException
This will remove the sprite from the SpriteWorld it is contained in and destroy its internal structures. The TwoDSprite must be reset after this call to recreate a Sprite object to attach it to a sprite world.

See Also:
createSprite
 o getSpriteInfo
 public TwoDSpriteInfo getSpriteInfo() throws QTException
Returns all of the pertinent information about the current sprite's state to recreate a sprite.

Returns:
the TwoDSprite info object that contains all of the information that the Sprite is presenting.
 o removeNotify
 protected void removeNotify() throws QTException
This call should not be called by an application. It is used by the Compositor to notify the Sprite that it is no longer valid - generally done when the Compositor is recreating its internal SpriteWorld.

 o createSprite
 public void createSprite(SpriteWorld sw) throws QTException
This will create a sprite object that presents the specified image and display options as specified in the contained info object.

Parameters:
sw - the Sprite world that the Sprite will appear in
 o getMatrix
 public Matrix getMatrix() throws QTException
This method returns the current matrix of the Transformable object.

 o setMatrix
 public void setMatrix(Matrix matrix) throws QTException
This method sets the current matrix of the Transformable object to the new matrix.

 o getInitialSize
 public Dimension getInitialSize() throws QTException
This method returns the original size before the transformations specified in the returned matrix are applied.

 o invalidate
 public final void invalidate() throws QTException
This method invalidates the portion of the sprite's sprite world which is occupied by the sprite.

 o hitTest
 public boolean hitTest(int flags,
                        QDPoint loc) throws QTException
This method tests if a point is inside a sprite.

Parameters:
flags - Specifies the control flags.
loc - Specifies the test point.
Returns:
true if the point is inside the sprite, false if not.
 o getDescription
 public ImageDescription getDescription() throws QTException
This method gets the image description property of this sprite.

Returns:
the image description.
 o setDescription
 public void setDescription(ImageDescription idh) throws QTException
This method sets the image description property of this sprite.

Parameters:
idh - Specifies the image description.
 o getImage
 public EncodedImage getImage() throws QTException
This method returns the actual image data.

Returns:
the image data
 o getVisible
 public boolean getVisible() throws QTException
This method gets the visibility property of this sprite.

Returns:
the visibility.
 o setVisible
 public void setVisible(boolean visible) throws QTException
This method sets the visibility property of this sprite.

Parameters:
visible - Specifies the visibility.
 o getLayer
 public int getLayer() throws QTException
This method gets the layer property of this sprite.

Returns:
the layer.
 o setLayer
 public void setLayer(int layer) throws QTException
This method sets the layer property of this sprite.

Parameters:
layer - Specifies the layer.
 o getGraphicsMode
 public GraphicsMode getGraphicsMode() throws QTException
This method gets the graphics mode property of this sprite.

Returns:
the graphics mode.
 o setGraphicsMode
 public void setGraphicsMode(GraphicsMode gMode) throws QTException
This method sets the graphics mode property of this sprite.

Parameters:
gMode - Specifies the graphics mode.
 o equals
 public boolean equals(Object obj)
Returns true if the TwoDSprite represents the same Sprite object

Overrides:
equals in class Object
 o toString
 public String toString()
Returns a String representation of this class.

Returns:
a String
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index